<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<!--  scriptList start -->
<script type="text/javascript" src="../js/jquery-1.7.1.js"></script>

<script type="text/javascript">
$(document).ready(function(){


	 $("#cancel").click(function(){  
		 
			 
	 	window.location.href="wins.php";
			 
	 })
});
</script>
<title>精彩图片信息</title>
<base target="_self">
<link rel="stylesheet" type="text/css" href="../css/admin/base.css" />
<link rel="stylesheet" type="text/css" href="../css/admin/main.css" />
<style type="text/css">
tr{
	height:40px;
}
input{
	width:500px; 
	background:url(../images/admin/inputbg.gif) repeat-x; 
	border:solid 1px #d1d1d1; 
	font-size:9pt; 
	font-family:Verdana, Geneva, sans-serif;
	
}
</style>
</head>
<body leftmargin="8" topmargin='8'>
<?php
	require_once("upload_filepic.php");
	require_once("../conn.php"); 
	$id=$_GET['id'];
	if($id!=""){
	}else{
	$id=$_POST['id'];
	}
	$title=$_GET['title'];
	$type=$_GET['type'];

	if($type == "delete"){
		$id=$_GET['id'];
		$src=$_GET['src'];
		$sql = "delete from  t_qianse_pic where id=".$id;
		$rs = mysql_query($sql);
		$url = "../images/demoimages/".$src;
  		if(file_exists($url)){
   			unlink($url);
  		}
	}
?>


	 <table width="98%" align="center" border="0" cellpadding="4" cellspacing="1" bgcolor="#CBD8AC" style="margin-bottom:8px">
	 <tr bgcolor="#EEF4EA">
    <td colspan="2" background="../images/admin/wbg.gif" class='title'><span>
    <?php
		echo "精彩图片信息";
	?>
	</span></td>
  </tr>
  </table>
  <table width="98%" border="0" cellpadding="2" cellspacing="1"
			bgcolor="#D1DDAA" align="center" style="margin-top: 8px;">
			<tr bgcolor="#E7E7E7">
				<td height="24px" colspan="10" background="../images/admin/tbg.gif">&nbsp;文档列表&nbsp;</td>
			</tr>
			<tr align="center" bgcolor="#FAFAF1" style="height:22px;">
				<td width="20%">ID</td>
				<td width="30%">标题</td>
				<td width="30%">图片</td>
				<td width="20%">操作</td>
			</tr>

			<?php
							$sql = "select * from t_qianse_pic order by id";
							$rs = mysql_query($sql);
							while($row=mysql_fetch_array($rs)){

							$id=$row["id"];
							$src=$row["src"];
							$title=$row["title"];
						    $encode="gb2312";
							echo "<tr align='center' bgcolor='#FFFFFF'
									onMouseMove='javascript:this.bgColor='#FCFDEE';'
									onMouseOut='javascript:this.bgColor='#FFFFFF';' style='height:22px;padding:0;'>
									<td>$id</td>
									<td>$title</td>
									<td>$src</td>
									<td><a href='picsedit.php?id=$id&title=$title&src=$src'>编辑</a>|<a href='pics.php?id=$id&type=delete&src=$src'>删除</a></td>
									</tr>";
							}
					?>


			<tr align="right" bgcolor="#EEF4EA">
				<td height="36" colspan="10" align="center">
					<!--翻页代码 -->
				</td>
			</tr>
			
			<form  action="pics.php" method="post" enctype="multipart/form-data">
   <table width="98%" align="center" border="0" cellpadding="4" cellspacing="1" bgcolor="#CBD8AC" style="margin-bottom:8px">
   <tr bgcolor="#FFFFFF">
    <td width="25%" bgcolor="#FFFFFF">图片标题:</td>
    <td width="75%" bgcolor="#FFFFFF">
    <?php
		 echo "<input  type='text' name='title' id='title' /><br/> ";
	?>
	</td>
  </tr>
   <tr bgcolor="#FFFFFF">
    <td width="25%" bgcolor="#FFFFFF">图片上传:</td>
    <td width="75%" bgcolor="#FFFFFF">
    <?php
		 echo "<input style='display:none;' type='text' name='id' id='id' value= ".$id." /><br/> ";
		 echo "<input type='file' name='file' id='file' /><br/> ";
 		 echo "<input type='submit' name='submit' value='上传' style='width:60px;'/>";
	?>
	</td>
  </tr>
  </table>
	</form>
		</table>
		
	
</body>
</html>